package com.example.wanbaqian.adapter;

import android.content.Context;

import com.example.wanbaqian.R;
import com.example.wanbaqian.bean.LogInfo;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.List;

/**
 * Created by Administrator on 2017/4/6 0006.
 * 代理适配器
 */

public class FindApplyAdapter extends CommonAdapter<LogInfo> {

    public FindApplyAdapter(Context context, List<LogInfo> datas) {
        super(context, R.layout.item_findapply, datas);
    }

    @Override
    protected void convert(ViewHolder holder, LogInfo item, int position) {
        holder.itemView.setPadding(0, (position == 0) ? 50 : 0, 0, 0);
        holder.setTextColorRes(R.id.tv_content, item.getTrade_type().equals("1") ? R.color.colorRed : R.color.colorGreen);
        holder.setText(R.id.tv_content, item.getLog_remark());
        holder.setText(R.id.tv_time, "近期还款:" + item.getCurrent_stage() + "/" + item.getTotal_stage());
        holder.setText(R.id.tv_id, "编号： " + item.getMember_id());
        holder.setText(R.id.tv_name, "用户：" + item.getMember_name());
        holder.setText(R.id.tv_phone, "电话：" + item.getMember_mobile());
        holder.setText(R.id.tv_money, "借款金额：" + item.getLoan_amount());
    }
}
